/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sisgeroupas.view;

import javax.swing.JOptionPane;
import sisgeroupas.model.ModelCliente;

/**
 *
 * @author Frederico Ribeiro
 */
public class FrmPrincipal extends javax.swing.JFrame {

    /**
     * Creates new form FrmPrincipal
     */
    public FrmPrincipal() {
        initComponents();
        setLocationRelativeTo(null);//Centraliza a janela
        this.setExtendedState(MAXIMIZED_BOTH);//Maximiza a janela
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        dkpPrincipal = new javax.swing.JDesktopPane();
        tlbFerramentas = new javax.swing.JToolBar();
        btnCliente = new javax.swing.JButton();
        btnProduto = new javax.swing.JButton();
        btnFornecedor = new javax.swing.JButton();
        btnVenda = new javax.swing.JButton();
        mnbPrincipal = new javax.swing.JMenuBar();
        mnCadastro = new javax.swing.JMenu();
        submnCliente = new javax.swing.JMenuItem();
        submnProduto = new javax.swing.JMenuItem();
        submnFornecedor = new javax.swing.JMenuItem();
        mnVendas = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();
        submnBuscarVendas = new javax.swing.JMenuItem();
        submnDevolucao = new javax.swing.JMenuItem();
        mnFerramentas = new javax.swing.JMenu();
        submnConfiguracao = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jMenu1 = new javax.swing.JMenu();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Minha Loja");

        dkpPrincipal.setBackground(new java.awt.Color(204, 204, 255));

        tlbFerramentas.setRollover(true);

        btnCliente.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sisgeroupas/icones/cliente_32x32.png"))); // NOI18N
        btnCliente.setText("Cliente");
        btnCliente.setFocusable(false);
        btnCliente.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnCliente.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnCliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnClienteActionPerformed(evt);
            }
        });
        tlbFerramentas.add(btnCliente);

        btnProduto.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sisgeroupas/icones/6654_32x32.png"))); // NOI18N
        btnProduto.setText("Produto");
        btnProduto.setFocusable(false);
        btnProduto.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnProduto.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnProduto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnProdutoActionPerformed(evt);
            }
        });
        tlbFerramentas.add(btnProduto);

        btnFornecedor.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sisgeroupas/icones/fornecedor_32x32.png"))); // NOI18N
        btnFornecedor.setText("Fornecedor");
        btnFornecedor.setFocusable(false);
        btnFornecedor.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnFornecedor.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnFornecedor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnFornecedorActionPerformed(evt);
            }
        });
        tlbFerramentas.add(btnFornecedor);

        btnVenda.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sisgeroupas/icones/venda_32x32.png"))); // NOI18N
        btnVenda.setText("Venda");
        btnVenda.setFocusable(false);
        btnVenda.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnVenda.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnVenda.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnVendaActionPerformed(evt);
            }
        });
        tlbFerramentas.add(btnVenda);

        tlbFerramentas.setBounds(0, 0, 440, 68);
        dkpPrincipal.add(tlbFerramentas, javax.swing.JLayeredPane.DEFAULT_LAYER);

        mnCadastro.setText("Cadastro");

        submnCliente.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sisgeroupas/icones/cliente2_16x16.png"))); // NOI18N
        submnCliente.setText("Cliente");
        submnCliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                submnClienteActionPerformed(evt);
            }
        });
        mnCadastro.add(submnCliente);

        submnProduto.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sisgeroupas/icones/Produto_16x16.png"))); // NOI18N
        submnProduto.setText("Produto");
        submnProduto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                submnProdutoActionPerformed(evt);
            }
        });
        mnCadastro.add(submnProduto);

        submnFornecedor.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sisgeroupas/icones/fornecedor_16x16.png"))); // NOI18N
        submnFornecedor.setText("Fornecedor");
        submnFornecedor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                submnFornecedorActionPerformed(evt);
            }
        });
        mnCadastro.add(submnFornecedor);

        mnbPrincipal.add(mnCadastro);

        mnVendas.setText("Vendas");

        jMenuItem1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sisgeroupas/icones/venda_16x16.png"))); // NOI18N
        jMenuItem1.setText("Vendas");
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
            }
        });
        mnVendas.add(jMenuItem1);

        submnBuscarVendas.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sisgeroupas/icones/lupa2_16x16.png"))); // NOI18N
        submnBuscarVendas.setText("Buscar vendas");
        mnVendas.add(submnBuscarVendas);

        submnDevolucao.setText("Devolução");
        mnVendas.add(submnDevolucao);

        mnbPrincipal.add(mnVendas);

        mnFerramentas.setText("Ferramentas");

        submnConfiguracao.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sisgeroupas/icones/configuração_16x16.png"))); // NOI18N
        submnConfiguracao.setText("Configuração");
        mnFerramentas.add(submnConfiguracao);

        mnbPrincipal.add(mnFerramentas);

        jMenu2.setText("Relatórios");
        mnbPrincipal.add(jMenu2);

        jMenu1.setText("Sair");
        mnbPrincipal.add(jMenu1);

        setJMenuBar(mnbPrincipal);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(dkpPrincipal, javax.swing.GroupLayout.DEFAULT_SIZE, 436, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addComponent(dkpPrincipal, javax.swing.GroupLayout.DEFAULT_SIZE, 268, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void submnClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_submnClienteActionPerformed
        FrmIntCliente frmCliente = new FrmIntCliente();
        dkpPrincipal.add(frmCliente);
        frmCliente.setPosicao();
        frmCliente.setVisible(true);
    }//GEN-LAST:event_submnClienteActionPerformed

    private void btnClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnClienteActionPerformed
       FrmIntCliente frmCliente = new FrmIntCliente();
       dkpPrincipal.add(frmCliente);
       frmCliente.setPosicao();
       frmCliente.setVisible(true);
       
       
       
    }//GEN-LAST:event_btnClienteActionPerformed

    private void btnProdutoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnProdutoActionPerformed
        FrmIntProduto frmProduto = new FrmIntProduto();
        dkpPrincipal.add(frmProduto);
        frmProduto.setPosicao();
        frmProduto.setVisible(true);
    }//GEN-LAST:event_btnProdutoActionPerformed

    private void btnFornecedorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFornecedorActionPerformed
        FrmIntFornecedor frmFornecedor = new FrmIntFornecedor();
        dkpPrincipal.add(frmFornecedor);
        frmFornecedor.setPosicao();
        frmFornecedor.setVisible(true);
    }//GEN-LAST:event_btnFornecedorActionPerformed

    private void submnProdutoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_submnProdutoActionPerformed
        FrmIntProduto frmProduto = new FrmIntProduto();
        dkpPrincipal.add(frmProduto);
        frmProduto.setPosicao();
        frmProduto.setVisible(true);
    }//GEN-LAST:event_submnProdutoActionPerformed

    private void submnFornecedorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_submnFornecedorActionPerformed
        FrmIntFornecedor frmFornecedor = new FrmIntFornecedor();
        dkpPrincipal.add(frmFornecedor);
        frmFornecedor.setPosicao();
        frmFornecedor.setVisible(true);
    }//GEN-LAST:event_submnFornecedorActionPerformed

    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
        FrmIntVenda frmVenda = new FrmIntVenda(dkpPrincipal);
        dkpPrincipal.add(frmVenda);
        frmVenda.setPosicao();
        frmVenda.setVisible(true);
    }//GEN-LAST:event_jMenuItem1ActionPerformed

    private void btnVendaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnVendaActionPerformed
         FrmIntVenda frmVenda = new FrmIntVenda(dkpPrincipal);
        dkpPrincipal.add(frmVenda);
        frmVenda.setPosicao();
        frmVenda.setVisible(true);
    }//GEN-LAST:event_btnVendaActionPerformed

    
    
    /**
     * @param args the command line arguments
     */
    
    
    
    
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(FrmPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(FrmPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(FrmPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(FrmPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new FrmPrincipal().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnCliente;
    private javax.swing.JButton btnFornecedor;
    private javax.swing.JButton btnProduto;
    private javax.swing.JButton btnVenda;
    private javax.swing.JDesktopPane dkpPrincipal;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenu mnCadastro;
    private javax.swing.JMenu mnFerramentas;
    private javax.swing.JMenu mnVendas;
    private javax.swing.JMenuBar mnbPrincipal;
    private javax.swing.JMenuItem submnBuscarVendas;
    private javax.swing.JMenuItem submnCliente;
    private javax.swing.JMenuItem submnConfiguracao;
    private javax.swing.JMenuItem submnDevolucao;
    private javax.swing.JMenuItem submnFornecedor;
    private javax.swing.JMenuItem submnProduto;
    private javax.swing.JToolBar tlbFerramentas;
    // End of variables declaration//GEN-END:variables
}
